import com.sun.org.apache.xpath.internal.SourceTree;
import com.sun.org.apache.xpath.internal.objects.XString;
import com.sun.org.apache.xpath.internal.objects.XStringForChars;
import com.sun.org.apache.xpath.internal.objects.XStringForFSB;
import com.sun.xml.internal.ws.addressing.WsaActionUtil;
import sun.security.krb5.SCDynamicStoreConfig;
import sun.util.locale.provider.JRELocaleProviderAdapter;

import java.io.IOException;
import java.util.Random;
import java.util.Scanner;

public class TEST1 {

    public static void main23(String[] args) {
        Scanner sc = new Scanner(System.in);
        int age = sc.nextInt();
        if(age < 18) {
            System.out.println("少年");
        }else if(19<=age && age<=28) {
            System.out.println("青年");
        }else if(29<=age && age<=55) {
            System.out.println("中年");
        }else {
            System.out.println("老年");
        }
    }

    public static void main22(String[] args) {
        Random random = new Random();
        Scanner sc = new Scanner(System.in);
        int randNum = random.nextInt(100);
        while(true) {
            System.out.println("请输入你要猜的数字");
            int num = sc.nextInt();
            if(num < randNum) {
                System.out.println("小了");
            }else if (num == randNum) {
                System.out.println("猜对了");
                break;
            }else {
                System.out.println("大了");
            }
        }
    }

    public static void main21(String[] args) {
        System.out.print("Enter a Char:");
        char i = 0;
        try {
            i = (char) System.in.read();
        } catch (IOException e) {
            e.printStackTrace();
        }
        System.out.println("your char is :"+i);
    }

    public static void main20(String[] args) {
        int sum = 0;
        for(int num =1; num <= 5; num++){
            int fac = 1;
            for(int i = 1; i <= num; i++) {
                fac *= i;
            }
            sum += fac;
        }
        System.out.println(sum);
    }

    public static void main19(String[] args) {
        int fac = 1;
        for(int i = 1; i<=5; i++) {
            fac *= i;
        }
        System.out.println(fac);
    }

    public static void main18(String[] args) {
        int sum = 0;
        for(int i = 1; i<=100; i++) {
            sum += i;
        }
        System.out.println(sum);
    }

    public static void main17(String[] args) {
        for(int i = 1; i<=10; i++){
            System.out.println(i);
        }
    }

    public static void main16(String[] args) {
        int i= 1;
        while(i <= 100) {
            if(i % 15 != 0) {
                i++;
                continue;
            }
            System.out.println(i);
            i++;
        }
    }

    public static void main15(String[] args) {
        int i = 100;
        while (i <= 200) {
            if(i % 3 != 0) {
                i ++;
                continue;
            }
            System.out.println(i);
            i++;
        }
    }

    public static void main14(String[] args) {
        int num = 100;
        while (num <= 200) {
            if (num % 3 != 0) {
                num++; // 这里的 ++ 不要忘记! 否则会死循环.
                continue;
            }
            System.out.println("找到了 3 的倍数, 为:" + num);
            num++;
        }
    }

    public static void main13(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int num = 1;
        int sum = 0;
        while(num <= n) {
            int i = 1;
            int fac = 1;
            while(i <= num) {
                fac *= i;
                i++;
            }
            sum += fac;
            num++;
        }
        System.out.println(sum);
    }

    public static void main12(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();
        int i = 1;
        int fac = 1;
        while(i <= num) {
            fac *= i;
            i++;
        }
        System.out.println(fac);
    }

    public static void main11(String[] args) {
        int i = 1;
        int fac = 1;
        while(i <= 5) {
            fac *= i;
            i++;
        }
        System.out.println(fac);
    }

    public static void main10(String[] args) {
        int i = 1;
        int oddsum = 0;
        while (i <= 100) {
            oddsum += i;
            i += 2;
        }
        System.out.println(oddsum);
         i = 2;
         int evesum = 0;
         while( i <= 100) {
             evesum += i;
             i += 2;
         }
        System.out.println(evesum);
    }

    public static void main9(String[] args) {
        int i = 1;//循环的初始值
        int sum = 0;
        while (i <= 100) {
            sum += i;
            i++;//循环的步进
        }
        System.out.println(sum);
        i = 1;
        int sumOdd = 0;
        while (i <= 100) {
            sumOdd += i;
            i+=2;
        }
        System.out.println(sumOdd);
        i = 2;
        int sumEve = 0;
        while (i <= 100) {
            sumEve += i;
            i+=2;
        }
        System.out.println(sumEve);
    }

    public static void main8(String[] args) {
        int i = 1;
        int sum = 0;
        while (i <= 100) {
            sum = sum+i;
            i++;
        }
        System.out.println(sum);
    }

    public static void main7(String[] args) {
        String str = "hello";
        switch (str) {
            case "abc":
                System.out.println("1");
                break;
            case "hello":
                System.out.println("2");
                break;
            default:
                System.out.println("输入有误");
        }
    }

    public static void main6(String[] args) {
        int a = 1;
        switch (a) {
            case 1:
                System.out.println("1");
                break;
            case 2:
                System.out.println("2");
                break;
            case 3:
                System.out.println("3");
                break;
            case 10:
                System.out.println("10");
                break;
            default:
                System.out.println("输入有误!");
        }
    }

    public static void main5(String[] args) {
        int num = 10;
        if (num % 2 == 0) {
            System.out.println("num 是偶数");
            }  else {
                System.out.println("num 是奇数");
            }
        }

    public static void main4(String[] args) {
        int a= 1;
        int b= 2;
        int c = 3;
        int max1 = a > b ? a : b;
        int max2 = c > max1 ? c : max1;
        //int max = a > b ? (a>b ? a : b) : (b>c ? b : c);
        System.out.println(max2);
    }


    public static void main3(String[] args) {
        int a = 1;
        int b = 2;
        int c = a;
        a = b;
        b = c;
        System.out.println(a+""+b);
    }



    public static void main2(String[] args) {
        int a = 10;
        int b = ++a ;
        System.out.println(b);
    }




    public static void main1(String[] args) {
        double x = 2.0;
        int y = 4;
        x/=++y;
        System.out.println(x);
    }
}

